package MyGO.utils.enumerastion;

import java.util.ArrayList;
import java.util.List;

public enum VisTiOnDay {
    MORNING,      // 早上
    AFTERNOON,   // 下午
    ALLDAY;   // 全天

    @Override
    public String toString() {
        return switch (this) {
            case MORNING -> "早上";
            case AFTERNOON -> "下午";
            case ALLDAY -> "全天";
        };
    }

    public static VisTiOnDay parseVisitTimeOnDay(String time) {
        return switch (time) {
            case "早上" -> MORNING;
            case "下午" -> AFTERNOON;
            case "全天" ->ALLDAY;
            default -> null;
        };
    }

    public static List<VisTiOnDay> getVisTiOnDayList() {
        List<VisTiOnDay> visTiOnDayList = new ArrayList<>();
        visTiOnDayList.add(MORNING);
        visTiOnDayList.add(AFTERNOON);
        visTiOnDayList.add(ALLDAY);
        return visTiOnDayList;
    }
}
